package  com.ljpz.search.bean  ;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.codec.binary.StringUtils;
import org.apache.solr.client.solrj.beans.Field;

/**
 * Created by liujunchen on 2016/11/29.
 */
@JsonIgnoreProperties(ignoreUnknown =true)

public class Item {
    @Field("id")
    private  Long    id   ;
    @Field("title")
    private   String title   ;
    @Field("sellPoint")
    private  String sellPoint ;
    @Field("price")
    private  Long price  ;
    @Field("image")
    private  String image  ;
    @Field("cid")
    private  String  cid   ;
    @Field("status")
    private  Integer  status ;
    @Field("created")
    private  Long created;
    @Field("updated")
    private  Long updated;


    public Long  getId() {
        return id;
    }

    public void setId(Long  id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSellPoint() {
        return sellPoint;
    }

    public void setSellPoint(String sellPoint) {
        this.sellPoint = sellPoint;
    }

    public Long getPrice() {
        return price;
    }

    public void setPrice(Long price) {
        this.price = price;
    }


    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getCreated() {
        return created;
    }

    public void setCreated(Long created) {
        this.created = created;
    }

    public Long getUpdated() {
        return updated;
    }

    public void setUpdated(Long updated) {
        this.updated = updated;
    }

    public  String[] getImages(){
        return org.apache.commons.lang3.StringUtils.split(this.getImage(),',');
    }
    @Override
    public String toString() {
        return "Item{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", sellPoint='" + sellPoint + '\'' +
                ", price=" + price +
                ", image='" + image + '\'' +
                ", cid=" + cid +
                ", status=" + status +
                ", created=" + created +
                ", updated=" + updated +
                '}';
    }
}
